﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. 
// See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System.Threading.Actors.Languages
{
    // Common interface to which all language support packages must conform.
    public interface ILanguagePackage
    {
        // Query the language package as to whether or not it owns the specified method.
        // This will typically be ascertained by checking whether or not (somePrefix+methodName)
        // exists as a key.
        bool OwnsMethod(string methodName);

        // Query the language package as to whether or not it owns the given methodKey, which
        // includes a prefix.
        bool OwnsKey(string methodKeyWithPrefix);

        // Add a method implementation pertinent to the language package.
        // No methodName is provided because one already exists.  (E.g.,
        // we're adding a method with a known key on a replica.)
        void AddMethod(string methodImpl);

        // Add a method implementation with the specified method name.
        void AddMethod(string methodName, string methodImpl);

        // Call a method.
        object CallMethod(string methodName, params object[] methodArgs); 
    }
}
